refactor: simplify index query, warn on MariaDB connections#1439
Merged
dimitri-yatsenko merged 2 commits intomasterfrom Apr 29, 2026
Merged
refactor: simplify index query, warn on MariaDB connections#1439dimitri-yatsenko merged 2 commits intomasterfrom
dimitri-yatsenko merged 2 commits intomasterfrom
Conversation
Follow-up to #1437. Replace the EXPRESSION/fallback machinery with a single COLUMN_NAME-only query — functional indexes (NULL COLUMN_NAME) are silently skipped downstream. Functional-index detection is temporarily off the menu; no current consumer depends on it. Add a UserWarning at connect time when the server reports MariaDB. DataJoint 2.x is officially MySQL/PostgreSQL only; MariaDB compatibility is best-effort and may break in future releases. Pin CONTRIBUTING.md MySQL minimum to 8.0.13+ and reframe PostgreSQL as a peer production backend (not "an alternative").
2 tasks
test_describe round-trips Team().describe() through declare() and asserts the SQL matches the original definition. Team has functional indexes (json_value expressions), and Heading.indexes no longer captures functional indexes (NULL COLUMN_NAME rows are skipped), so describe() emits the table without them — the round-trip diverges. Skip the test until functional-index introspection is restored.
esutlie
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1437. Two changes:
get_indexes_sql(). Drop the EXPRESSION/fallback machinery: replace theCOALESCE(COLUMN_NAME, CONCAT('(', EXPRESSION, ')'))primary query (and theget_indexes_sql_fallback()method, and the try/except wrapper inheading.py) with a singleCOLUMN_NAME-only query. Functional indexes (NULLCOLUMN_NAME) are silently skipped downstream — the existing filter already handles them.UserWarningat connect time when the server reports MariaDB. DataJoint 2.x is officially MySQL/PostgreSQL only; MariaDB compatibility is best-effort and may break in future releases.Also: pin
CONTRIBUTING.mdMySQL minimum to 8.0.13+ and reframe PostgreSQL as a peer production backend (not "an alternative").Companion docs PR: datajoint/datajoint-docs#161
Trade-off
Functional-index detection by
@schemais temporarily off the menu on all backends. No current consumer depends on it. When functional indexes are restored later, that PR can decide on the right MySQL version floor (and may turn the MariaDB warning into a hard error).Test plan
tests/unit/test_connection_warning.py(8 cases: 3 MariaDB strings warn, 5 MySQL strings don't).pixi run -e test pytest tests/unit/— 257 passed).ruff checkandruff formatclean.mariadb:10.11:@schemasucceeds, warning fires, noUnknown column 'EXPRESSION'.mysql:8.0: no warning fires.